package com.base.sampleproject;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.Button;

import com.devnn.base.BaseActivity;
import com.sample.view.LukyDrawView;
import com.sample.view.NewLukyDrawView;

public class NewLukyDrawActivity extends BaseActivity {
    private Button btnControl;
    private NewLukyDrawView lukyDrawView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_new_luky_draw);
        super.onCreate(savedInstanceState);

    }

    @Override
    protected void init() {
        lukyDrawView= (NewLukyDrawView) findViewById(R.id.lukydraw);
        btnControl= (Button) findViewById(R.id.control);
        btnControl.setOnClickListener(this);
    }

    @Override
    protected void setData() {

    }

    @Override
    public void onClick(View v) {
        if(btnControl.getText().equals("开始")){
            btnControl.setText("停止");
            lukyDrawView.start();
        }else if(btnControl.getText().equals("停止")){
            btnControl.setText("开始");
            lukyDrawView.stop();
//            super.showInfoDialog("恭喜抽中："+lukyDrawView.getPrize());
        }
    }
}
